package com.heima.wemedia.scan.runner;

import com.heima.model.wemedia.dto.WmNewsDto;
import com.heima.utils.common.SensitiveWordUtil;
import com.heima.wemedia.scan.dao.WmSensitiveDao;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class WmNewsApplicationRuner implements ApplicationRunner {
    @Resource
    WmSensitiveDao wmSensitiveDao;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        //获取所有敏感词
        List<String> wordsList = wmSensitiveDao.queryWordsList();
        SensitiveWordUtil.initMap(wordsList);
    }
}
